package cn.com.blueInfo.bpm.person.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.person.entity.UserAccount;
import cn.com.blueInfo.bpm.person.request.UserAccountDTO;
import cn.com.blueInfo.bpm.person.response.UserAccountVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 员工账户表 对象转换
 * @author suxch
 * @since 2025-08-31 16:18:02
 */
@Mapper(componentModel = "spring")
public interface UserAccountConvert
        extends BaseConvert<UserAccount, UserAccountDTO, UserAccountVO> {

    UserAccount dtoToEntity(UserAccountDTO dto);

    UserAccount dtoToEntity(UserAccountDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "accountStatus", target = "accountStatus", qualifiedByName = "enumToDesc")
    @Mapping(source = "mfaStatus", target = "mfaStatus", qualifiedByName = "enumToDesc")
    UserAccountVO entityToVO(UserAccount entity);

}